﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MaxLeaf.Common;
using System.Data.SqlClient;
using MaxLeaf.DB;
using System.Data;


namespace MaxLeaf.DAL.K2K
{
    public class t_icItemDeletedDAL : BaseDAL
    {
 

        public override int Update(DBAccess dbOrgK3Con, DBAccess dbDestK3Con, string strKeyValue)
        {
            string strSql = " Update t_Item Set FDeleted=@disabled Where  not FDeleted=@disabled And FItemID=@fitemid; Update t_ICItem Set FDeleted=@disabled Where not FDeleted=@disabled And FItemID=@fitemid";
            dbDestK3Con.ExecuteSql(strSql, new System.Data.IDataParameter[] { 
                new SqlParameter("@disabled",CvtFunc.ToInt(dbOrgK3Con.GetValue("select fdeleted from t_icitem where  fitemid=@fitemid",new System.Data.IDataParameter[] { new SqlParameter("@fitemid",strKeyValue) })).ToString())
                ,new SqlParameter("@fitemid",GetDestMapKeyValue(dbOrgK3Con,dbDestK3Con, strKeyValue).ToString())
            });
            return 0;
            
            
        }

        
    }
}
